/*
 * @Author: Tendo 
 * @Date: 2021-09-08 10:05:00 
 * @param {ListNode} head
 * @return {ListNode}
 * @desc 反转链表[递归法]
 */
var reverse = function(pre, head) {
    if(!head) return pre;
    const temp = head.next;
    head.next = pre;
    pre = head
    return reverse(pre, temp);
}

var reverseList = function(head) {
    return reverse(null, head);
};